package com.crpc.common.exception;

import com.crpc.common.crpcEnum.CrpcExceptionEnums;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class CrpcException extends RuntimeException {
    private final int code;
    private final String msg;

    public CrpcException(CrpcExceptionEnums crpcExceptionEnum) {
        this.code = crpcExceptionEnum.getCode();
        this.msg = crpcExceptionEnum.getMessage();
    }

    public CrpcException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}